# $Id$
# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Alexander Baldeck <alexander@archlinux.org>
# Contributor: tobias <tobias@archlinux.org>

pkgname=ftgl
_pkgver=2.1.3-rc5
pkgver=${_pkgver/-/}
pkgrel=10
pkgdesc="OpenGL library to use arbitrary fonts"
arch=(i686 x86_64)
url="https://sourceforge.net/projects/ftgl/"
license=(MIT)
depends=(freetype2 glu)
makedepends=(doxygen mesa graphviz)
source=("https://downloads.sourceforge.net/$pkgname/$pkgname-$_pkgver.tar.bz2")
sha256sums=('521ff7bd62c459ff5372e269c223e2a6107a6a99a36afdc2ae634a973af70c59')

prepare() {
  cd $pkgname-${_pkgver/-/\~}
  sed -i '/^SUBDIRS =/s/demo//' Makefile.in
  printf '%s\n' >>docs/doxygen.cfg.in \
    HAVE_DOT=yes DOT_IMAGE_FORMAT=svg INTERACTIVE_SVG=yes
}

build() {
  cd $pkgname-${_pkgver/-/\~}
  ./configure --prefix=/usr --with-pic --disable-static
  make
}

package() {
  cd $pkgname-${_pkgver/-/\~}
  make DESTDIR="$pkgdir" install

  # FS#23283: install missing headers for OpenCascade
  install -m644 src/FT{Face,Library,Size}.h "$pkgdir/usr/include/FTGL/"

  install -Dm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
